﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MicropleSoft.Controls.QueryControls
{
    public class QueryItemCondition
    {
        public static List<QueryItemCondition> GetQueryItemConditions()
        {
            var list = new List<QueryItemCondition>();

            var item = new QueryItemCondition
                           {
                               Caption = "包含",
                               Key = "include",
                               Value = " like '%{0}%'"
                           };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "不包含",
                Key = "not include",
                Value = " not like '%{0}%'"
            };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "开始",
                Key = "start",
                Value = " like '{0}%'"
            };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "结束",
                Key = "end",
                Value = " like '%{0}'"
            };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "相同",
                Key = "same",
                Value = " = '{0}'"
            };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "不同",
                Key = "not same",
                Value = " <> '{0}'"
            };
            list.Add(item);

            item = new QueryItemCondition
            {
                Caption = "其中之一",
                Key = "the one",
                Value = " in ('{0}')"
            };
            list.Add(item);

            return list;
        }

        public string Caption { get; set; }
        public string Key { get; set; }
        public string Value { get; set; }
    }
}
